<?php

/**
 *显示分类列表
 */
function showclasslist($MenuID,$datalist,$showfield,$FromSet_Config_Array,$xiajicount){
	$showfield_arr=explode("|",$showfield);
	$showfield_count=count($showfield_arr);
	foreach($datalist as $key=>$datavalue){
				$g=substr_count($datavalue[5],',');
			    if($datavalue[2]==0){
					echo "<tr class=\"YKTtr\" Height=\"30\">";
				}else{
					echo "<tr class=\"YKTtd\" Height=\"30\">";
				}
				$g_string='';
				for($i=1;$i<=$g;$i++){
					if($i==$g){
						$g_string.=" |-";
					}else{
						$g_string.=" |";
					}
				}
				for($j=0;$j<$showfield_count;$j++){
					$F_ConfigString=$FromSet_Config_Array[$showfield_arr[$j]];
					$F_ConfigString_Array=explode('|',$F_ConfigString);
					if($showfield_arr[$j]==1){
						echo "<td align=\"left\" height=\"30\" style=\"padding-left:10px;color:#0099cc; background-color:#FFFFFF\">{$g_string} {$datavalue[$showfield_arr[$j]]}</td>";
					}elseif(intval($F_ConfigString_Array[1])==2||intval($F_ConfigString_Array[1])==3||intval($F_ConfigString_Array[1])==4){
						echo "<td align=\"left\" height=\"30\" style=\"padding-left:10px;color:#0099cc; background-color:#FFFFFF\">{$g_string} ".YKT_GetClassName($datavalue[$showfield_arr[$j]])."</td>";
					}elseif(intval($F_ConfigString_Array[1])==6){
						
						$showimgpic=is_file(SITEROOT.$datavalue[$showfield_arr[$j]])?'<img src="'.$datavalue[$showfield_arr[$j]].'" onmousemove="moveimg(this,event,\'showimgdiv\')" width="150" height="100" onmouseout="outimg(\'showimgdiv\')"/>':'暂无图片';
						echo "<td style=\"padding-left:10px;width:180px; text-align:center;color:#0099cc; background-color:#FFFFFF\">{$g_string} ".$showimgpic."</td>";
					}elseif(intval($showfield_arr[$j])==0 || intval($showfield_arr[$j])==3){
						echo "<td align=\"center\" style=\" text-align:center; color:#0099cc; background-color:#FFFFFF\">{$g_string} {$datavalue[$showfield_arr[$j]]}</td>";
					}else{
						echo "<td align=\"left\" style=\"padding-left:10px;color:#0099cc; background-color:#FFFFFF\">{$g_string} {$datavalue[$showfield_arr[$j]]}</td>";
					}
				}
				   echo "<td align=\"center\" style=' background-color:#FFFFFF'>";
				   if($g<$xiajicount-1){
				   	echo "<a href=\"ClassSys_add.php?MenuID={$MenuID}&Superior={$datavalue[0]}\" style=\"color:#0099cc;\" class=\"Link12\">添加下级</a> | ";
				   }
				   echo " <a href=\"ClassSys_UpDate.php?MenuID={$MenuID}&id={$datavalue[0]}\" style=\"color:#0099cc;\"  class=\"Link12\">修改</a> |  <a href=\"ClassSys_Delete.php?MenuID={$MenuID}&id={$datavalue[0]}\"  style=\"color:#0099cc;\" class=\"Link12\">删除</a>
				    </td>
				  </tr>";
	}
}

?>